package com.cmcc.pp.ui.platformmonitoring;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.LinearLayout;

import com.cmcc.pp.R;
import com.cmcc.pp.base.BActivity;

import butterknife.Bind;
import butterknife.ButterKnife;
import butterknife.OnClick;

/**
 * Created by ABC on 2017/12/29.
 * 所选择网元的服务器列表
 */

public class ServerlistActivity extends BActivity {
    @Bind(R.id.item_lin_seriverlist)
    LinearLayout item_lin_seriverlist;
    @Bind(R.id.serverlist_lin_server)
    LinearLayout serverlistLinServer;

    @Override
    protected boolean getHasTitle() {
        return true;
    }

    @Override
    public int getContentLayoutId() {
        return R.layout.activity_serverlist;
    }

    @Override
    public void initView(Bundle savedInstanceState) {
        getHeader().setTitle("Nginx");
    }

    @Override
    public void loadData() {

    }


    @OnClick({
            R.id.serverlist_lin_server,
            R.id.item_lin_seriverlist
    })
    public void onClick(View view) {
        switch (view.getId()) {
            case R.id.serverlist_lin_server://选择网元
                openChoiceNet();
                break;
            case R.id.item_lin_seriverlist://进入服务器详情
                openServerDetails();
                break;
        }
    }


    private void openChoiceNet() {
        Intent serverDetailsIntent = new Intent(this, ChoiceNetElementActivity.class);
        startActivity(serverDetailsIntent);
    }


    //打开服务器详情
    private void openServerDetails() {
        Intent serverDetailsIntent = new Intent(this, ServerDetailsActivity.class);
        startActivity(serverDetailsIntent);

    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        // TODO: add setContentView(...) invocation
        ButterKnife.bind(this);
    }
}
